package com.lzy.system.organization.config;

import com.lzy.system.organization.handler.UserArgumentResolver;
import org.junit.jupiter.api.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @author lcc
 * @since 2023/12/30 下午6:23
 * @description contorller 添加自定义参数解析器
 **/
@Order(2)
@Configuration
public class UserWebMvcConfigurer implements WebMvcConfigurer {
    @Autowired
    private UserArgumentResolver userArgumentResolver;

    /**
     * 添加自定义参数解析器
     * @param argumentResolvers
     */
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(userArgumentResolver);
    }

}
